<html>
<body>

<style>
.content { line-height: 24px; font-family: monospace; font-size: 14px; color: #636363; text-transform: uppercase; top: 38%; position: relative; text-align: center; perspective: 1000px }
.content h1, .content h2 { font-weight: normal; letter-spacing: 1px; }
.content h2 { font-size: 15px; }
.content #details {
    text-align: left; display: inline-block; width: 350px; background-color: white; padding: 17px 27px; border-radius: 0px;
    box-shadow: 0px 2px 7px -1px #d8d8d8; text-transform: none; margin: 15px; transform: scale(0) rotateX(90deg); transition: all 0.6s cubic-bezier(0.785, 0.135, 0.15, 0.86);
}
.content #details #added { font-size: 12px; text-align: right; color: #a9a9a9; }

#button { transition: all 1s cubic-bezier(0.075, 0.82, 0.165, 1); opacity: 0; transform: translateY(50px); transition-delay: 0.5s }
.button {
    padding: 8px 20px; background-color: #FFF85F; border-bottom: 2px solid #CDBD1E; border-radius: 2px;
    text-decoration: none; transition: all 0.5s; background-position: left center; display: inline-block; margin-top: 10px; color: black;
}
.button:hover { background-color: #FFF400; border-bottom: 2px solid #4D4D4C; transition: none; }
.button:active { position: relative; top: 1px; }
.button:focus { outline: none; }

</style>

<div class="content">
 <h1>Site blocked</h1>
 <h2>This site is on your blacklist:</h2>
 <div id="details">
  <div id="reason">Too much image</div>
  <div id="added">on 2015-01-25 12:32:11</div>
 </div>
 <div><a href="#Visit+Site" class="button button-submit" id="button">Remove from blacklist</a></div>
</div>

<script type="text/javascript" src="js/ZeroFrame.js"></script>

<script>
class Page extends ZeroFrame {
    onOpenWebsocket () {
    	this.cmd("wrapperSetTitle", "Blacklisted site - ZeroNet")
        this.cmd("siteInfo", {}, (site_info) => {
            this.site_info = site_info
        })
        this.cmd("blacklistList", {}, (blacklists) => {
            this.blacklists = blacklists
            var address = document.location.search.match(/address=(.*?)[&\?]/)[1]
            var reason = blacklists[address]["reason"]
            if (!reason) reason = "Unknown reason"
            var date = new Date(blacklists[address]["date_added"] * 1000)
            document.getElementById("reason").innerText = reason
            document.getElementById("added").innerText = "at " + date.toLocaleDateString() + " " + date.toLocaleTimeString()
            document.getElementById("details").style.transform = "scale(1) rotateX(0deg)"
            document.getElementById("button").style.transform = "translateY(0)"
            document.getElementById("button").style.opacity = "1"
            document.getElementById("button").onclick = () => {
                this.cmd("blacklistRemove", address, () => { this.cmd("wrapperReload") })
            }
        });
    }
}
page = new Page()
</script>
</body>
</html>